package com.shuma.product.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.shuma.product.mapper.GoodsDetailInfoMapper;
import com.shuma.product.pojo.GoodsDetailInfo;
import com.shuma.product.service.GoodsDetailInfoService;
import org.springframework.stereotype.Service;

/**
 * @author 23083
 * @description 针对表【goods_detail_info】的数据库操作Service实现
 * @createDate 2024-06-16 21:13:27
 */
@Service
public class GoodsDetailInfoServiceImpl extends ServiceImpl<GoodsDetailInfoMapper, GoodsDetailInfo>
        implements GoodsDetailInfoService {
    @Override
    //判断detail合法
    public boolean exactGoodDail(GoodsDetailInfo goodsDetailInfo){
        //数据的基本不能为空
        //getGoodsType
        if (goodsDetailInfo.getGoodsDetailId() == null||
                goodsDetailInfo.getGoodsAvatar()==null||
                goodsDetailInfo.getDescription()== null||
                goodsDetailInfo.getGoodsType()== null||
                goodsDetailInfo.getGoodsCategoryId()== null||
                goodsDetailInfo.getGoodsRich()== null||
                goodsDetailInfo.getSuppier()== null||
                goodsDetailInfo.getSuppierConnect()== null||
                goodsDetailInfo.getServiceGuarante()== null||
                goodsDetailInfo.getPriceType()== null||
//                goodsDetailInfo.getIntegralPrice()== null||
//                goodsDetailInfo.getCashPrice()== null||
                goodsDetailInfo.getLimited()== null||
                goodsDetailInfo.getCityWhitlist()== null||
                goodsDetailInfo.getCityBlacklist()== null||
                goodsDetailInfo.getGoodsType()<1||
                goodsDetailInfo.getGoodsType()>3||
                goodsDetailInfo.getGoodsAvatar().length()>100||
                goodsDetailInfo.getDescription().length()>100||
                goodsDetailInfo.getSuppier().length()>100||
                goodsDetailInfo.getSuppierConnect().length()>100)
            return false;
        return true;
    }
}




